<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>demo</title>
    <script type="text/javascript" src="../vue.js"></script>
</head>

<body>
    <div id="app">
        <h1>{{count}}</h1>


        <button @contextmenu.prevent="">右键</button>

        <div @click="fn1">
            outer1
            <div @click.stop="fn2">inner1</div>
        </div>
        <div @click.capture="fn1">
            outer2
            <div @click="fn2">inner2</div>
        </div>
        <button @click.once="fn1">触发fn1</button>
        <div @click.self="fn1">
            outer3
            <div @click="fn2">inner3</div>
        </div>
        <input type="text" @keyup.13="fn1"> <br>
        <input type="text" @keyup.enter="fn2">
        <input type="text" @keyup.space="fn1">
        <input type="text" @keydown.tab="fn2">
        <input type="text" @keydown.esc="fn1">
    </div>
</body>
<script type="text/javascript">
    Vue.config.productionTip = false
    const vm = new Vue({
        el: "#app",
        data() {
            return {
                count: 0
            }
        },
        methods: {
            fn1() {
                console.log("fn1111");
            },
            fn2() {
                console.log("fn2222");
            }
        }
    })
</script>

</html>